<?php
namespace Home\Controller;
use Think\Controller;

class IndexController extends Controller {

    public function index($themes = 'green'){  
        $this->themes = $themes;  
        $this->name = 'Jim'; 
        $this->menu = '功能菜单';

        //$Data = D('MailBox');
        $Data = M('Mailbox');
        $this->data = $Data->select();

        $this->display();
    }

    public function test()
    {
    	$this->name = 'Tom';

    	//$Data = D('MailBox');
    	$Data = M('Mailbox');
    	$this->data = $Data->select();

    	$this->display();
    }

    public function getThemes($value='green')
    {
        $data = array(
                array(id => 'gray', text => 'gray'),
                array(id => 'metro', text => 'metro'),
                array(id => 'green', text => 'green'),
                array(id => 'red', text => 'red'),
                array(id => 'orange', text => 'orange'),
            );
        $this->ajaxReturn($data,'json');
    }

    public function getDept()
    {
        $data = array(
                array(id => 1, text => 'IT'),
                array(id => 2, text => 'HR'),
                array(id => 3, text => 'RD'),
                array(id => 4, text => 'QA')
            );
        $this->ajaxReturn($data,'json');
    }
}